// JavaScript Document
function editCate(id,cate,stt)
{
	document.getElementById("idCate").value = parseInt(id);
	document.getElementById("cate").value = cate;
	document.getElementById("stt").value = stt;
	loadEditer();
}
function loadEditer()
{
	showLoadingPage();
	$("#edit-box").fadeIn(1000);
		//
		
		
		// Add the mask1 to body
		$('body').append('<div id="mask2" onclick="javascript:exit();"></div>');
		$('#mask2').fadeIn(300);
	var popMargTop = ($("#edit-box").height() + 24) / 2; 
		var popMargLeft = ($("#edit-box").width() + 24) / 2; 
		
		$("#edit-box").css({ 
			'margin-top' : -popMargTop,
			'margin-left' : -popMargLeft
		});
	}
	function exit()
	{
		$('#mask2 , .edit-popup').fadeOut(300) ; 
		removeMask();
		$("#loadingpage").fadeOut(1000);
	}
	function removeMask(){$('#mask2').remove(); 
	} 
	
function createObject() 
{
	var request_type;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer")
	{
		request_type = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
	request_type = new XMLHttpRequest();
	}
	return request_type;
}

var http = createObject();

var nocache = 0;

function loadCategoriesAdmin(page) 
{
	showLoadingPage();
	http.open('get', 'process/processCategoriesAdmin.php?page='+page);
	http.onreadystatechange = loadCateAdminReply;
	http.send(null);

}
function loadCateAdminReply()
{
	if(http.readyState == 4){
	var response = http.responseText;
	// else if login is ok show a message: "Site added+ site URL".
	$("#tablecate").html(response);
	$("#loadingpage").fadeOut(1000);
	}
}